<h1>Request Details</h1>
<?=Html::anchor(Request::$controller . 'requests/', '&larr; back to requests');?>
<?php $model = new Model_Admin_Requests(); ?>

<? if($request) : ?>
    <table class="w100" style="margin-top: 15px;">
        <tr>
                <!--left block-->
            <td class="w30">
                <table class="w100">
                    <tr>

                        <td><strong>Name: </strong><?=$request['name']?></td>
                    </tr>

                    <tr>
                        <td><strong>Last name: </strong><?=$request['last_name']?></td>
                    </tr>

                    <tr>
                        <td><strong>Email: </strong><?=$request['email']?></td>
                    </tr>

                    <tr>
                        <td><strong>Phone: </strong><?=$request['phone']?></td>
                    </tr>

                    <tr>
                        <td><strong>Address: </strong><?=$request['address']?></td>
                    </tr>

                    <tr>
                        <td><strong>Zip-code: </strong><?=$request['zip_code']?></td>
                    </tr>

                    <tr>
                        <td><strong>Residence type: </strong><?=$request['residence_type']?></td>
                    </tr>
                </table>

            </td>
                <!--right block-->
            <td class="w66">
                <table class="w100 center">
                    <? if(!empty($request['id'])) : ?>
                        <tr>
                            <th class="border padding10" style="width: 100px;">
                                Order Id
                            </th>
                            <td class="border padding10" style="width: 100px;">
                                <?=$request['id']?>
                            </td>
                        </tr>
                    <? endif; ?>

                    <? if(!empty($request['clean_type'])) : ?>
                        <tr>
                            <th class="border padding10" style="width: 100px;">
                                Clean type
                            </th>
                            <td class="border padding10" style="width: 100px;">
                                <?=Model_Admin_Requests::parseRequestCleanType($request['clean_type'])?>
                            </td>
                        </tr>
                    <? endif; ?>

                    <? if(!empty($request['bedrooms'])) : ?>
                        <tr>
                            <th class="border padding10" style="width: 100px;">
                                Bedrooms
                            </th>
                            <td class="border padding10" style="width: 100px;">
                                <?=Model_Admin_Requests::parseRequestBedrooms($request['bedrooms'])?>
                            </td>
                        </tr>
                    <? endif; ?>

                    <? if(!empty($request['bathrooms'])) : ?>
                        <tr>
                            <th class="border padding10" style="width: 100px;">
                                Bathrooms
                            </th>
                            <td class="border padding10" style="width: 100px;">
                                <?=(Model_Admin_Requests::parseRequestBathrooms($request['bathrooms'])) ? Model_Admin_Requests::parseRequestBathrooms($request['bathrooms']) : $request['bathrooms'] ?>
                            </td>
                        </tr>
                    <? endif;?>

                    <? if(!empty($request['periodicity'])) : ?>
                        <tr>
                            <th class="border padding10" style="width: 100px;">
                                How often
                            </th>
                            <td class="border padding10" style="width: 100px;">
                                <?=Model_Admin_Requests::parseRequestHowOften($request['periodicity']) ?>
                            </td>
                        </tr>
                    <? endif;?>

                    <? if(!empty($request['best_time'])) : ?>
                        <tr>
                            <th class="border padding10" style="width: 100px;">
                                Best time
                            </th>
                            <td class="border padding10" style="width: 100px;">
                                <?=$request['best_time']?>
                            </td>
                        </tr>
                    <? endif;?>

                    <? if(!empty($request['details'])) : ?>
                        <tr>
                            <th class="border padding10" style="width: 100px;">
                                Details
                            </th>
                            <td class="border padding10" style="width: 100px;">
                                <?=$request['details']?>
                            </td>
                        </tr>
                    <? endif;?>

                    <? if(!empty($request['business_type'])) : ?>
                        <tr>
                            <th class="border padding10" style="width: 100px;">
                                Business type
                            </th>
                            <td class="border padding10" style="width: 100px;">
                                <?=$request['business_type']?>
                            </td>
                        </tr>
                    <? endif; ?>

                    <? if(!empty($request['rooms'])) : ?>
                        <tr>
                            <th class="border padding10" style="width: 100px;">
                                Rooms
                            </th>
                            <td class="border padding10" style="width: 100px;">
                                <?=$request['rooms']?>
                            </td>
                        </tr>
                    <? endif; ?>

                    <? if(!empty($request['square'])) : ?>
                        <tr>
                            <th class="border padding10" style="width: 100px;">
                                Square
                            </th>
                            <td class="border padding10" style="width: 100px;">
                                <?=$request['square']?>
                            </td>
                        </tr>
                    <? endif; ?>

                    <? if(!empty($request['levels'])) : ?>
                        <tr>
                            <th class="border padding10" style="width: 100px;">
                                Levels
                            </th>
                            <td class="border padding10" style="width: 100px;">
                                <?=(Model_Admin_Requests::parseRequestLevels($request['levels'])) ? Model_Admin_Requests::parseRequestLevels($request['levels']) : $request['levels'] ?>
                            </td>
                        </tr>
                    <? endif; ?>

                </table>
            </td>
        </tr>
    </table>

<? endif; ?>


